package com.zbs.simbot.factory;

import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class BasePluginFactory {

    private final static Map<String, BasePlugin> basePluginMap  = new ConcurrentHashMap<>();;


    public static BasePlugin getBasePlugin(String name){
        return basePluginMap.get(name);
    }

    public static void register(String pluginName, BasePlugin basePlugin){
        basePluginMap.put(pluginName,basePlugin);
    }

    public static Collection<BasePlugin> getAllBasePlugin(){
        return basePluginMap.values();
    }
}